<?php
	class PaymentAccount
	{
		private $money;
		private $holder;
		
		public function __construct($money, $holder)
		{
			$this->setAccMoney($money);
			$this->setAccHolder($holder);
		}
		
		public function setAccHolder($holder)
		{
			$this->holder=$holder;
		}
		
		public function setAccMoney($money)
		{
			$this->money=$money;
		}
		
		public function getAccMoney()
		{
			return $this->money;
		}
		
		public function getAccHolder()
		{
			return $this->holder;
		}
		
		public function deposit($add)
		{
			if($add<0)
			{
				echo "Invalit input!";
			}
			else 
			{
				$this->money+=$add;
			}
		}
		
		public function withdraw($take)
		{
			if($this->money<=0)
			{
				echo "No money in this account";
			}
			elseif ($this->money-$take<0) 
			{
				echo "Not enough money in this account";
			}
			else 
			{
				$this->money-=$take;
			}
		}
	};
	
	$user=new PaymentAccount("Marina",100);
	$reflection=new ReflectionClass($user);
	
	$methods=$reflection->getMethods();
	
	
	$classMethodNames = array();
	foreach ($methods as $index) {
		$name=$index->getName();
		$classMethodNames[] = $name;
		$method=$reflection->getMethod($name);
		$param=$method->getParameters();
	
		if(count($param)==0)
		{
			echo $name."<br>";
		}
	}
	
// 	echo "All methods: <br>";
// 	foreach ($classMethodNames as $method)
// 	{
// 		echo $method."<br>";
// 	}
	$prop=$reflection->getProperties();
	foreach ($prop as $pr)
	{
		if($pr->isPrivate())
		{
			$pr->setAccessible(true);
			$pr->setValue($user,NULL);
		}
	}
	var_dump($user);
	
?>